import math
import sys
import os
import struct

n = 500
widths = 8
wave = []
f = open("sin_wave.bin", "wb")

for i in range(n):
    a = int((math.sin(2 * 3.1415926 * (i / n ) + math.pi * 3 / 2) + 1) * (math.pow(2, widths) - 1) / 2)
    wave.append(a)
    f.write(struct.pack('H', a))
f.close 

print(wave)

